<template>
    <table >
        <tr>
            <td>门店名称</td>
            <td>
                <span>{{info.shopName  }}</span>
            </td>
        </tr>
        <tr>
            <td>门店描述</td>
            <td>
                <span>{{ info.shopDescription }}</span>
            </td>
        </tr>
        <tr>
            <td>分店名称</td>
            <td>
                <span>{{ info.fenshopname }}</span>
            </td>
        </tr>
        <tr>
            <td>门店地址</td>
            <td>
                <span>{{ info.shopAddress }}</span>
            </td>
        </tr>
        <tr>
            <td>门店电话号</td>
            <td>
                <span>{{ info.phone }}</span>
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
               <input type="button" value="确认"/>
            </td>
        </tr>
    </table>
</template>
<script setup lang="ts">
    import { ref,onMounted } from 'vue';
import axios from 'axios';
import { useRoute } from 'vue-router';

const route=useRoute();

onMounted(()=>{
    Show();
})

const info=ref({
    "id": 0,
      "shopName": "",
      "shopDescription": "",
      "fenshopname": "",
      "shopAddress": "",
      "phone": ""
})

const Show=()=>{
    axios.get("https://localhost:7216/api/Shop/GetShopByid?id="+route.params.id)
    .then(res=>{
        info.value=res.data;
    })
    .catch(err=>{
        console.log(err);
    })
}

</script>